#!/bin/bash

# first the lifev package
#src=$(adapt tool get https://github.com/lifev/lifev/archive/master.tar.gz life_current.tar.gz) 
src=$(adapt tool get ~/adapt/repo/lib/lifev/lifev_emory_experimental.tar.gz)

pushd $src

# everything here would be in adapt, but I do not want to complicate now


mkdir bld 2>&- # the dir may exist already

cd bld

rm -rf CMake* # remove old config files (probably it may be coerced in cmake options)


adapt cmake \
  -D CMAKE_CXX_FLAGS=-DNDEBUG \
  -D CMAKE_BUILD_TYPE:STRING=RELEASE \
  -D CMAKE_INSTALL_PREFIX:PATH=$(adapt query sys/prefix) \
  -D LifeV_ENABLE_Core:BOOL=ON \
  -D LifeV_ENABLE_NavierStokes:BOOL=ON \
  -D LifeV_ENABLE_Operator:BOOL=ON \
  -D LifeV_ENABLE_ECM2:BOOL=ON \
  ..

#  -D Trilinos_DIR=/home/jaross/adapt/soft/lib/cmake/Trilinos \
adapt make
adapt make install

popd
